package com.cszb.springcloudhystrixserver.controller;

import com.cszb.springcloudhystrixserver.entity.User;
import com.cszb.springcloudhystrixserver.service.HystrixService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:CrazyShaQiuShi
 * @email: 1047812462@qq.com
 * @createTime: 2018-10-11 17:01
 * @version: 1.0
 */
@RestController
public class HystrixController {
    @Autowired
    public HystrixService hystrixService;

    @GetMapping("/ribbon/{id}")
    public User findById(@PathVariable Long id) {
        return this.hystrixService.findById(id);
    }
}
